Skip to content

bench: add pub/sub throughput benchmark - #150

Merged
kacy merged 1 commit into
mainfrom
bench/pubsub-benchmark
Feb 15, 2026
Merged

bench: add pub/sub throughput benchmark#150
kacy merged 1 commit into
mainfrom
bench/pubsub-benchmark

Conversation

@kacy

@kacy kacy commented Feb 15, 2026

Copy link
Copy Markdown
Owner

summary

  • new bench-pubsub.sh and bench-pubsub.py for measuring pub/sub performance
  • tests publish throughput, fan-out delivery rate, and delivery latency
  • test matrix: 1/10/100 subscribers × 64B/1KB messages × SUBSCRIBE/PSUBSCRIBE
  • messages embed publish timestamps for accurate end-to-end latency measurement
  • 1k warmup messages before each timed run
  • supports --quick flag for sanity checks (1k messages)

what was tested

  • verified subscriber threads correctly subscribe and receive messages
  • confirmed latency measurement via embedded timestamps in message payloads
  • tested that PSUBSCRIBE pattern matching works with bench:* patterns

design considerations

  • uses threading (not asyncio) for subscriber connections since redis-py's pubsub is blocking
  • 30-second safety timeout per subscriber prevents hangs if messages are lost
  • publisher sends synchronously (single connection) to measure raw publish rate

new benchmark measuring ember's pub/sub performance:

- bench-pubsub.sh: shell wrapper (starts server, runs tests, formats output)
- bench-pubsub.py: python harness using redis-py with threading

measures across a test matrix of:
- subscriber counts: 1, 10, 100
- message sizes: 64B, 1KB
- subscription types: SUBSCRIBE vs PSUBSCRIBE

reports publish throughput (msg/sec from single publisher), fan-out
delivery rate (total messages received across all subscribers per second),
and p50/p95/p99 delivery latency. warmup of 1k messages before measurement.

saves JSON results to bench/results/ for downstream processing.
@kacy
kacy merged commit b9455db into main Feb 15, 2026
6 of 7 checks passed
@kacy
kacy deleted the bench/pubsub-benchmark branch February 15, 2026 13:13
kacy added a commit that referenced this pull request Feb 19, 2026
new benchmark measuring ember's pub/sub performance:

- bench-pubsub.sh: shell wrapper (starts server, runs tests, formats output)
- bench-pubsub.py: python harness using redis-py with threading

measures across a test matrix of:
- subscriber counts: 1, 10, 100
- message sizes: 64B, 1KB
- subscription types: SUBSCRIBE vs PSUBSCRIBE

reports publish throughput (msg/sec from single publisher), fan-out
delivery rate (total messages received across all subscribers per second),
and p50/p95/p99 delivery latency. warmup of 1k messages before measurement.

saves JSON results to bench/results/ for downstream processing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant